package com.example.nophase.activity.wageGroup;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import androidx.appcompat.widget.Toolbar;
import com.example.nophase.Fragment.BatchOfPayFragment;
import com.example.nophase.R;
import com.example.nophase.base.BaseActivity;
import com.example.nophase.entity.ApplyForListDTO;
import com.example.nophase.utils.MessageEvent;
import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class BatchOfPayActivity extends BaseActivity {


    @BindView(R.id.toolbar_btn)
    Button toolbarBtn;
    @BindView(R.id.home_toobar)
    Toolbar homeToobar;
    @BindView(R.id.content_container)
    FrameLayout contentContainer;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_batch_of_pay);
        ButterKnife.bind(this);

        getSupportFragmentManager().
                beginTransaction().
                add(R.id.content_container,
                        BatchOfPayFragment.newInstance(0)).commit();
        setToolbar();
    }

    private void setToolbar() {
        homeToobar.setNavigationIcon(R.drawable.ic_left_black_24dp);
        homeToobar.setTitle("");
        setSupportActionBar(homeToobar);
        getSupportActionBar().setHomeButtonEnabled(true);
    }


    @OnClick(R.id.toolbar_btn)
    public void onViewClicked() {

        EventBus.getDefault().post(new MessageEvent("ok"));
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {

            case android.R.id.home:
                this.finish();
                return true;

        }
        return super.onOptionsItemSelected(item);
    }


//    private void initData() {
//        SysUserVO sysUserVO = LoginManager.getUserInfo(this);
//        String uuid = sysUserVO.getUuid();
//        HttpUtils.getInstance().setAuthToken(LoginManager.getToken(this));
//        Call<BaseResp<RecordsDTO<ApplyForListDTO>>> call = HttpUtils.getInstance().getApiService(RequstCommonApi.class).lodaAdultFinshed("ANDROID", 10, 1);
//        call.enqueue(new BaseCallBack<BaseResp<RecordsDTO<ApplyForListDTO>>>() {
//            @Override
//            public void onSuccess(Response<BaseResp<RecordsDTO<ApplyForListDTO>>> response) throws Exception {
//                List<ApplyForListDTO> list = response.body().getData().getRecords();
//                ivBackground.setVisibility(View.GONE);
//                for (ApplyForListDTO item : list) {
//                    resultList.add(item);
//
//                }
//            }
//            @Override
//            public void onFailure(String message) {
//            }
//        });
//    }
}
